In my PLC Logic, i realized the logic for Alarm bits (Discrete alarm for Filling valve malfunctioning and saturation) was not reliable. I was getting alarm bits while the filling valve works fine as well. This problem arises because the scan time is too fast to differentiate the 'Level' and 'level_old' values. To overcome this problem i have created 1 second delay in updating the values. Kindly check the modified logic below:
Figure 1: Modified logic in SCL Code of PI Function Block
Figure 2: Updating Level information in another Double word MD34 after every 1 second
Figure 3: Input block updated in FB PI for MD34 as input. This input is compared as shown in Figure 1.
There is always scope for improvement in PLC Logic.
Regards,
Rajvir Singh